package com.music.service.songs.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import com.music.service.songs.beans.Song;
import com.music.service.songs.dao.SongDAO;

public class SongServiceImpl implements SongService {
	private SongDAO mSongDAO;

	/**
	 * @return the songDAO
	 */
	public SongDAO getSongDAO() {
		return mSongDAO;
	}

	/**
	 * @param pSongDAO the songDAO to set
	 */
	@Required
	public void setSongDAO(SongDAO pSongDAO) {
		mSongDAO = pSongDAO;
	}

	@Override
	public boolean addNewSong(Long pMemberId, String pSongName) {
		return getSongDAO().addNewSong(pMemberId, pSongName);
	}

	@Override
	public boolean checkMemberPermissionForSong(Long pMemberId, Long pSongId) {
		return getSongDAO().checkMemberPermissionForSong(pMemberId, pSongId);
	}

	@Override
	public boolean deleteSong(Long pMemberId, Long pSongId) {
		return getSongDAO().deleteSong(pMemberId, pSongId);
	}

	@Override
	public boolean editSongName(Long pMemberId, Long pSongId, String pSongName) {
		return getSongDAO().editSongName(pMemberId, pSongId, pSongName);
	}

	@Override
	public boolean setPreferredUrlForSongForMember(Long pMemberId,
			Long pSongId, Long pUrlId) {
		return getSongDAO().setPreferredUrlForSongForMember(pMemberId, pSongId, pUrlId);
	}

	@Override
	public List<Song> viewSongs(Long... pSongIds) {
		return getSongDAO().viewSongs(pSongIds);
	}

	@Override
	public List<Song> getSongsFromPlaylistId(Long pPlaylistId) {
		return getSongDAO().getSongsFromPlaylistId(pPlaylistId);
	}
	
	
}
